<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder'); 
date_default_timezone_set('EUROPE/MOSCOW');
Yii::app()->setLanguage('ru_ru');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return CMap::mergeArray(
	require(dirname(__FILE__).'/db.php'),
    array(
		'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
		'name'=>Yii::t( 'base', 'Site of dargin language' ),

		// preloading 'log' component
		'preload'=>array('log'), 

		// autoloading model and component classes
		'import'=>array(
			'application.models.*',
			'application.components.*',
		),

		'modules'=>array(
			// uncomment the following to enable the Gii tool
		),

		// application components
		'components'=>array(
			'user'=>array(
				// enable cookie-based authentication
				'allowAutoLogin'=>true,
			),
			// uncomment the following to enable URLs in path-format

			'urlManager' => array(
				'urlFormat' => 'path',
				'showScriptName' => false,
				'caseSensitive'=>false,
				'rules' => array(
					// стандартное правило для обработки '/' как 'site/index'
					'' => 'site/index',
					// стандартное правило для обработки '/login' как 'site/login' и т.д.
					'<action:(login|logout|about)>' => 'site/<action>',
					// своё правило для URL вида '/Производитель/Модель'
					// стандартное правило для обработки 'post/update' и др.
					array(
						'class' => 'application.components.ContentUrlRule',
						'connectionID' => 'db',
					),
					//'<controller:\w+>' => '<controller>',
					'<controller:\w+>' => '<controller>/index',
					'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
					'<controller:\w+>/<id:\d+>/<title>' => '<controller>/view',
					'<controller:\w+>/<id:\d+>' => '<controller>/view',
				),
			),
			/**/
			'errorHandler'=>array(
				// use 'site/error' action to display errors
				'errorAction'=>'site/error',
			),
			'log'=>array(
				'class'=>'CLogRouter',
				'routes'=>array(
					array(
						'class'=>'CFileLogRoute',
						'levels'=>'error, warning',
					),
				),
			),
		),

		'params'=>array(
			// this is used in contact page
			'adminEmail' => 'mekegi@gmail.com',
		),
	)
);
